Back

Contents

For both the Jetson and rpi:

Base package installation and setup

$ sudo snap install microk8s --classic 
$ microk8s enable dns helm3 ingress storage dashboard rbac registry
$ microk8s start

Edit the hostname to something sensible:

$ sudo vim /etc/hostname

Edit /etc/hosts to include the worker head and worker nodes.

Rpi4

Need to set up cgroups:

$ sudo vim /boot/firmware/cmdline.txt

at the end of the file add:

cgroup_enable=memory cgroup_memory=1

reboot and repeat for each of your nodes.

Aliases

Edit bash aliases:

$ sudo vi ~/.bash_aliases

and add:

alias kubectl="microk8s kubectl"
alias helm3="microk8s helm3"
alias temp="sudo echo CPU `vcgencmd measure_temp | awk -F = '{ print $2 }' | awk -F \' '{ print $1 }'`°C"

Jetson

Temperature control and monitoring

Install the fan controller:

$ git clone https://github.com/Pyrestone/jetson-fan-ctl.git ~/

Install the temperature monitor:

$ git clone https://github.com/MartinMatta/Jetson-Nano-temperature ~/
$ chmod 755 Jetson-Nano-temperature/temp.sh

Aliases

Edit bash aliases:

$ sudo vi ~/.bash_aliases

and add:

alias temp="bash -c ~/Jetson-Nano-temperature/temp.sh"
alias kubectl="microk8s kubectl"
alias helm3="microk8s helm3"

microk8s setup

Add ubuntu user to microk8s group and set permissions on the .kube config:

$ sudo usermod -a -G microk8s ubuntu
$ sudo chown -f -R ubuntu ~/.kube

log out back in.

Add access to the Docker registry. Edit /etc/docker/daemon.json on all nodes, including the FQDN to the server head, e.g.

"insecure-registries" : ["localhost:32000", ...]

Master

To add a worker node

Issue the add-node command to get the required token to add a worker node.

$ microk8s add-node

Worker nodes

To join a cluster

$ microk8s join ... (output token from add-node)

Top